MPC control algorithm